﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 战棋模拟器
{
    class 无私的英雄:Minion
    {
        public 无私的英雄():base()
        {
            Attack = 2;
        }
        public override void Deathrattle()
        {
            List<int> unShieldedList = new List<int>();
            int available = 0;
            for (int i = 0; i < 7; i++)
            {
                if (pool.places[i] == null)
                    break;
                if (!pool.places[i].Skills[3])
                {
                    available++;
                    unShieldedList.Add(i);
                }
            }
            if (available == 0)
                return;
            byte[] buffer = Guid.NewGuid().ToByteArray();
            int iSeed = BitConverter.ToInt32(buffer, 0);
            Random ran = new Random(iSeed);
            int RandKey = ran.Next(0, available);
            pool.places[unShieldedList[RandKey]].Skills[3] = true;
            base.Deathrattle();
        }


        public override Minion NewOne()
        {
            return new 无私的英雄();
        }
    }


    class 无私的英雄_金色 : 无私的英雄
    {
        public 无私的英雄_金色() : base()
        {
            Attack *= 2;
            Health *= 2;
            count *= 2;
            buff *= 2;
        }

        public override Minion NewOne()
        {
            return new 无私的英雄_金色();
        }


        public override void Deathrattle()
        {
            List<int> unShieldedList = new List<int>();
            int available = 0;
            for (int i = 0; i < 7; i++)
            {
                if (pool.places[i] == null)
                    break;
                if (!pool.places[i].Skills[3])
                {
                    available++;
                    unShieldedList.Add(i);
                }
            }
            if (available == 0)
                return;
            byte[] buffer = Guid.NewGuid().ToByteArray();
            int iSeed = BitConverter.ToInt32(buffer, 0);
            Random ran = new Random(iSeed);
            int RandKey = ran.Next(0, available);
            pool.places[unShieldedList[RandKey]].Skills[3] = true;
            base.Deathrattle();
        }
    }
}
